﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LoginSqlServer.LIB
{
    public class Constants
    {
        public class MS_SQL
        {
            public const String INPUT = "@{0} {1}";
            public const String INPUT_EX = "\n\t, {0}";
            public const String WHERE = "({0}.{1} = @{2})";
            public const String WHERE_EX = "\n\t\t\t\tAND {0}";

            public const String WHERE_LIST_KEY = " AND (a.{0} IN (SELECT CAST(Item AS BIGINT) FROM dbo.SplitString(@{1}, ',', 1, 1))";

            public const String BEGIN_TRANSACTION = "\n\tDECLARE @errNumb INT, @errMsg VARCHAR(MAX)" +
                                                    "\n\tSET XACT_ABORT ON" +
                                                    "\n\tBEGIN TRANSACTION;" +
                                                    "\n\tBEGIN TRY";
            public const String END_TRANSACTION = "\n\t\tCOMMIT TRANSACTION;" +
                                                    "\n\tEND TRY" +
                                                    "\n\tBEGIN CATCH" +
                                                    "\n\t\tROLLBACK TRANSACTION;" +
                                                    "\n\t\tSET @errNumb = ERROR_NUMBER()" +
                                                    "\n\t\tSET @errMsg = ERROR_MESSAGE() + '-' + ERROR_SEVERITY() + '-' + ERROR_STATE() + '-' + ERROR_PROCEDURE() + '-' + ERROR_LINE()" +
                                                    "\n\t\tRAISERROR ('%d - %s', 16, 1111, @errNumb, @errMsg) " +
                                                    "\n\tEND CATCH;";

            public static string COMMENT_CODE_SQL = "\n-- =============================================" +
                        "\n-- This stored procedure is generated by " + Constants.Information.Copyright +
                        "\n-- Project:	" + Constants.Information.ProjectName +
                        "\n-- Author:	" + Constants.Information.Author +
                        "\n-- Create date: " + DateTime.Now +
                        "\n-- Description:	" +
                        "\n-- Revise History:	" +
                        "\n-- =============================================\n";

            public static string CHECK_EXIST_PROCEDURE = "\nUSE [{0}]" +
                "\nGO" +
                "\nIF EXISTS (SELECT * FROM DBO.SYSOBJECTS WHERE ID = OBJECT_ID(N'[DBO].[{1}]') AND OBJECTPROPERTY(ID, N'IsProcedure') = 1)" +
                "\nDROP PROCEDURE [DBO].[{2}]" +
                "\nGO";
        }

        public class CSharp
        {
            public static string COMMENT_CODE_CSHARP = "\n// =============================================" +
                        "\n// This stored procedure is generated by " + Constants.Information.Copyright +
                        "\n// Project:	" + Constants.Information.ProjectName +
                        "\n// Author:	" + Constants.Information.Author +
                        "\n// Create date: " + DateTime.Now +
                        "\n// Description:	" +
                        "\n// Revise History:	" +
                        "\n// =============================================\n";

            public static string COMMENT_CODE_CSHARP_DESIGNER = "//------------------------------------------------------------------------------" +
            "\n// <auto-generated>" +
            "\n//     This code was generated by a tool." +
            "\n//" +
            "\n//     Changes to this file may cause incorrect behavior and will be lost if" +
            "\n//     the code is regenerated. " +
            "\n// </auto-generated>" +
            "\n//------------------------------------------------------------------------------\n";
        }

        public class FileExtension
        {
            public const string Ascx = "UC.ascx";
            public const string AscxCs = "UC.ascx.cs";
            public const string AscxDesignerCs = "UC.ascx.designer.cs";

            public const string Master = ".Master";
            public const string MasterCs = ".Master.cs";
            public const string MasterDesignerCs = ".Master.designer.cs";

            public const string Aspx = "UI.aspx";
            public const string AspxCs = "UI.aspx.cs";
            public const string AspxDesignerCs = "UI.aspx.designer.cs";
            public const string DataAccessObject = ".cs";
            public const string EntityObject = ".cs";
            public const string StoreProcedure = ".sql";
        }

        public class FolderTemp
        {
            public const string Bootstrap_Admin = "Admin";
            public const string Bootstrap_UserControl = "UserControl";
            public const string Aspx = "UserControls";
            public const string AspxCs = "UserControls";
            public const string AspxDesignerCs = "UserControls";
            public const string DataAccessObject = "DataAccessObject";
            public const string EntityObject = "EntityObject";
            public const string StoreProcedure = "StoreProcedure";
            public const string SharedLibraries = "SharedLibraries";
            public const string App_Themes = "App_Themes";
            public const string Template = "Template";
            public const string Fonts = "Fonts";
            public const string DLL = "DLL";
            public const string PublicInterface = "PublicInterface";
            public const string Scripts = "Scripts";
            public const string Images = "Images";
        }

        public class FileTemp
        {
            public const string Style_css = "Style.css";
            public const string SqlDataProvider_cs = "SqlDataProvider.cs";
            public const string Constants_cs = "Constants.cs";
            public const string GetListConstants_cs = "GetListConstants.cs";
            public const string GetTextConstants_cs = "GetTextConstants.cs";
            public const string Utilities_cs = "Utilities.cs";

        }

        public class Information
        {
            public const string ProjectName = "ThangNM";
            public const string Author = "ThangNM";
            public const string ServerName = "ANHNH31-PC\\SQLEXPRESS";
            public const string UserName = "sa";
            public const string Password = "abc@123";
            public const string DatabaseName = "EHOU";
            public const string Copyright = "ThangNM";
        }



    }
}
